fix: repair cross-package bugs to make all tests pass - #97
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed useDebounce hook (was useThrottle), keep public useSearchDebounce alias - Button: forward aria-label so icon-only buttons have an accessible name (WCAG 4.1.2) - DataTable: use functional setState updater to fix stale-closure sort toggle - formatDate: correct locale/format string to match expected output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all four cross-package bugs so
bun run testis fully green (13 pass, 0 fail). Each fix targets a documented bug with a covering test; no test files, dependencies, or unrelated code were touched.Changes
apps/web/src/lib/api.ts— TheuseThrottlehook in@e2e/utilswas renamed touseDebounce, but the app still imported the old name. Updated the import and re-export (export { useDebounce as useSearchDebounce }). The publicuseSearchDebouncename is unchanged, satisfying the export test.packages/ui/src/components/Button/Button.tsx— An icon-only button had no accessible name (WCAG 4.1.2). Forwardedaria-labelso the icon-only button exposes an accessible name.packages/ui/src/components/DataTable/DataTable.tsx— The sort-direction toggle capturedsortDirin a stale closure. Switched to the functional updater formsetSortDir(prev => prev === "asc" ? "desc" : "asc"), fixing the controlled re-render test.packages/utils/src/format/date.ts—formatDateused the wrong locale/format string. Corrected it to produce the format the test expects.Verification
bun run test→ 13 pass, 0 fail across 5 files../node_modules/.bin/tsc --noEmit→ the one real source-level type error (missinguseThrottleexport) is resolved.Assumptions
tscerrors areCannot find module 'bun:test'in test files only. These are pre-existing (confirmed by type-checking the base commit) and stem frombun-typesnot being wired into test-file type resolution. The task forbids modifying test files and these are unrelated to the source bugs, so they are left untouched.